<?php
/**
 * Created by PhpStorm.
 * User: fengsenhua
 * Date: 2019/2/11
 * Time: 13:57
 */

namespace app\api\controller\v1;
use app\api\model\Category as CategoryModel;
use app\lib\exception\CategoryException;

class Category
{
    public function getAllCategoris(){
        $categories=CategoryModel::all([],'img');
        if(empty($categories)){
            throw new CategoryException();
        }
        return $categories;
    }
}